<?php

namespace web\common\command;

use addons\member\model\MemberAccountModel;
use addons\shop\model\ShopOrder;
use web\common\model\sys\SysParameterModel;
use think\Config;
use think\console\Command;
use think\console\Input;
use think\console\input\Option;
use think\console\input\Argument;
use think\console\Output;
use think\Exception;
use think\Db;

class Order extends Command{

    /**
     * 定义命令
     */
    protected function configure(){
        $this->setName('Order')->setDescription('RUN ETH Data RPC API');
        $this->addArgument('action', Argument::REQUIRED, "The name of the function");
        //参数2
        $this->addArgument('param', Argument::OPTIONAL, "The name of the param");
    }
    
    protected function execute(Input $input, Output $output) {
        $action = $input->getArgument('action');
        $param = $input->getArgument('param');
        if (method_exists($this,$action)) {
            $this->$action($param);
        }
        else{
            echo "method is not exists\n";
        }
    }


    /**
     * 7天自动确认收货
     */
    public function sevenConfirm(){
        (new ShopOrder)->sevenConfirm();
    }
}